package com.iptv.grape.ui.frgmt.my;

import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.iptv.grape.R;
import com.iptv.grape.SystemAct;
import com.iptv.grape.ui.BaseFrgmt;
import com.iptv.grape.ui.adpt.SystemAdpt;
import com.iptv.grape.ui.frgmt.my.impls.SystemInfo;
import com.iptv.grape.ui.frgmt.my.impls.SystemMgr;
import com.iptv.grape.util.AppLog;
import com.iptv.grape.util.SystemUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 系统信息
 */
public class SystemInfoFrgmt extends BaseFrgmt {
    @Override
    protected int layoutId() {
        return R.layout.frgmt_system_info;
    }

    @Override
    protected void initView(@NonNull View view, @Nullable Bundle savedInstanceState) {
        SystemInfo info= SystemMgr.build();
        TextView textView1 = view.findViewById(R.id.tvValue1);
        textView1.setText(info.getModel());
        TextView textView2 = view.findViewById(R.id.tvValue2);
        textView2.setText(info.getAndroidVersion());
        TextView textView3 = view.findViewById(R.id.tvValue3);
        textView3.setText(info.getFirmware());
        TextView textView4 = view.findViewById(R.id.tvValue4);
        textView4.setText(info.getDevelopmentVersion());
        TextView textView5 = view.findViewById(R.id.tvValue5);
        textView5.setText(info.getIP());
        TextView textView6 = view.findViewById(R.id.tvValue6);
        textView6.setText(info.getMac());
    }
    private void logaa(){
        StringBuilder stringBuilder = new StringBuilder();
        //BOARD 主板
        stringBuilder.append("支撑运营商代码 : ") .append(SystemUtil.getOperator()).append("\n");
        stringBuilder.append("硬件厂商名称 : ") .append(SystemUtil.getHard()).append("\n");
        stringBuilder.append("设备型号 : ") .append(SystemUtil.getEquipment()).append("\n");
        stringBuilder.append("操作系统版本 : ") .append(SystemUtil.getAndroid()).append("\n");
        stringBuilder.append("牌照方厂家 : ") .append(SystemUtil.getLicence()).append("\n");
        stringBuilder.append("CDN厂家 : ") .append(SystemUtil.getCdn()).append("\n");
        AppLog.getCurLog().e(stringBuilder.toString());
    }

    private  void log() {
        AppLog.getCurLog().e("data ===>>>>");
        StringBuilder stringBuilder = new StringBuilder();
        //BOARD 主板
        stringBuilder.append("主板>>>BOARD: ") .append( android.os.Build.BOARD).append("\n");
        stringBuilder.append(", 系统启动程序版本号>>>BOOTLOADER: ") .append( android.os.Build.BOOTLOADER).append("\n");
//BRAND 运营商
        stringBuilder.append(", 系统定制商>>>BRAND: ") .append( android.os.Build.BRAND).append("\n");
        stringBuilder.append(", cpu指令集>>>CPU_ABI: ") .append( android.os.Build.CPU_ABI).append("\n");
        stringBuilder.append(", cpu指令集2>>>CPU_ABI2: ") .append( android.os.Build.CPU_ABI2).append("\n");

//DEVICE 驱动
        stringBuilder.append(", 设置参数>>>DEVICE: ") .append( android.os.Build.DEVICE).append("\n");
//DISPLAY Rom的名字 例如 Flyme 1.1.2（魅族rom） &nbsp;JWR66V（Android nexus系列原生4.3rom）
        stringBuilder.append(", 显示屏参数>>>DISPLAY: ") .append( android.os.Build.DISPLAY).append("\n");
//指纹
        stringBuilder.append(", 硬件识别码>>>FINGERPRINT: ") .append( android.os.Build.FINGERPRINT).append("\n");
//HARDWARE 硬件
        stringBuilder.append(", 硬件名称>>>HARDWARE: ") .append( android.os.Build.HARDWARE).append("\n");
        stringBuilder.append(", HOST>>>HOST: ") .append( android.os.Build.HOST).append("\n");
        stringBuilder.append(", Build.ID>>>ID: ") .append( android.os.Build.ID).append("\n");
//MANUFACTURER 生产厂家
        stringBuilder.append(", 硬件制造商>>>MANUFACTURER: ") .append( android.os.Build.MANUFACTURER).append("\n");
//MODEL 机型
        stringBuilder.append(", 版本>>>MODEL: ") .append( android.os.Build.MODEL).append("\n");
        stringBuilder.append(", 手机制造商>>>PRODUCT: ") .append( android.os.Build.PRODUCT).append("\n");
        stringBuilder.append(", RADIO: ") .append( android.os.Build.RADIO).append("\n");
        stringBuilder.append(", 描述Build的标签>>>RADITAGSO: ") .append( android.os.Build.TAGS).append("\n");
        stringBuilder.append(", TIME>>>TIME: ") .append( android.os.Build.TIME).append("\n");
        stringBuilder.append(", builder类型>>>TYPE: ") .append( android.os.Build.TYPE).append("\n");
        stringBuilder.append(", USER>>>USER: ") .append( android.os.Build.USER).append("\n");
//VERSION.RELEASE 固件版本
        stringBuilder.append(", VERSION.RELEASE: ") .append( android.os.Build.VERSION.RELEASE).append("\n");
        stringBuilder.append(", VERSION.CODENAME: ") .append( android.os.Build.VERSION.CODENAME).append("\n");
//VERSION.INCREMENTAL 基带版本
        stringBuilder.append(", VERSION.INCREMENTAL: ") .append( android.os.Build.VERSION.INCREMENTAL).append("\n");
//VERSION.SDK SDK版本
        stringBuilder.append(", VERSION.SDK: ") .append( android.os.Build.VERSION.SDK).append("\n");
        stringBuilder.append(", VERSION.SDK_INT: ") .append( android.os.Build.VERSION.SDK_INT).append("\n");
        stringBuilder.append("无线电固件版本>>>" ).append(Build.getRadioVersion());
        stringBuilder.append("硬件序列号>>>SERIAL：").append( Build.SERIAL);
        AppLog.getCurLog().e("data ===>>>>"+stringBuilder.toString());
    }

}
